Back to course home
0% completed
Vote For New Content
Appendix
Contact Us
Shortest Common Super-sequence
Problem Statement
Given two sequences 's1' and 's2', write a method to find the length of the shortest sequence which has 's1' and 's2' as subsequences.
Example 2:
Input: s1: "abcf" s2:"bdcf"
Output: 5
Explanation: The shortest common super-sequence (SCS) is "abdcf".
Example 2:
Input: s1: "dynamic" s2:"programming"
Output: 15
Explanation: The SCS is "dynprogrammicng".
Constraints:
1 <= s1.length, s2.length <= 1000s1ands2consist of lowercase English letters.
Try it yourself
Try solving this question here:
Java
Saved to Cloud
. . . .
Solution: Maximum Sum Increasing Subsequence
Solution: Shortest Common Super-sequence
Mark as Completed
On this page
Problem Statement
Try it yourself